<!DOCTYPE html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>Dojo Mobile Test</title>

	<script type="text/javascript" src="../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','TabBar']"></script>
	<script type="text/javascript" src="../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true"></script>

	<script type="text/javascript">
		require([
		    "dojo/ready",
		    "dijit/registry",
			"dojox/mobile/ListItem",
			"dojox/mobile/parser",
			"dojox/mobile",
			"dojox/mobile/ScrollableView",
			"dojox/mobile/TabBar",
			"dojox/mobile/TabBarButton",
			"dojox/mobile/RoundRectList",
			"dojox/mobile/LongListMixin"
		], function(ready, registry, ListItem){
			fillList = function(list){
				for(var i = 0; i < 2000; i++){
					list.addChild(new ListItem({
						variableHeight:true,
						style:"font-size:10px",
						innerHTML: 	i + '. <a href="#" class="lnk">Book Title '+i+'</a><br>'+
									'Author '+i+'<br>'+
									'Eligible for FREE Super Saver Shipping<br>'+
									'<span style="color:red">$14.50 (50%)</span> In Stock<br>'+
									'# ('+i+')'
					}));
				}
			};
			ready(function(){
				fillList(list1);
				registry.byId("view2").on("beforeTransitionIn", function(){
					if(list2.getChildren().length == 0){
						fillList(list2);
					}
				})
			});
		});
	</script>

	<style type="text/css">
	</style>
</head>

<body style="visibility:hidden;">
		<ul data-dojo-type="dojox.mobile.TabBar" data-dojo-props='barType:"segmentedControl", fixed:"top"'>
			<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props='moveTo:"view1", selected:true'>With Mixin</li>
			<li data-dojo-type="dojox.mobile.TabBarButton" data-dojo-props='moveTo:"view2"'>Without Mixin</li>
		</ul>
		<div data-dojo-type="dojox/mobile/ScrollableView" id="view1">
			<div data-dojo-id="list1" data-dojo-type="dojox/mobile/EdgeToEdgeList" data-dojo-mixins="dojox/mobile/LongListMixin"></div>
		</div>
		<div data-dojo-type="dojox/mobile/ScrollableView" id="view2">
			<div data-dojo-id="list2" data-dojo-type="dojox/mobile/EdgeToEdgeList"></div>
		</div>
</body>
</html>
